package fc.testmain;

import cn.hutool.http.HttpRequest;

import java.util.Map;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.alibaba.fastjson.JSON;
import fc.FcHttpCon;

public class test001 {
    public static void main(String[] args) {

String json_param=


"{\"key\": \"f5458f5c0f9022db743a7c0710145903\",\"type\": \"sync\",\"host\": {\"prod\": \"oa\",\"ip\": \"192.168.0.1\",\"lang\": \"zh_CN\",\"acct\": \"tiptop\",\"timestamp\": \"20230912123204361\"},\"service\": {"+
        "\"prod\": \"T100\",\"name\": \"apst300_crt\",\"ip\": \"192.168.0.2\",\"id\": \"topprd\"},\"datakey\": {\"EntId\": \"2\",\"CompanyId\": \"ZH00\"},"+
        "\"payload\": {\"std_data\": {\"parameter\": {\"p1\": \"\",\"p2\": \"\"}},\"param\": {\"top\": {\"user_code\": \"MW23060119061\",\"memo\": \"备注，测试用\"},"+
        "\"data\": [{\"idx\": 1,\"code\": \"M0401028A-120-X089A\",\"requst_date\": \"2024-08-01\",\"amount\": 2,\"project\": \"MWI-20240605004-1-2\",\"memo\": \"备注测试1\"},{\"idx\": 2,\"code\": \"S0100110773A\","+
        "\"requst_date\": \"2024-08-02\",\"amount\": 3,\"project\": \"\",\"memo\": \"备注测试2\"}]}}}";
        String data = HttpRequest.post(FcHttpCon.ZH_YFSY_XQ).body(json_param).execute().body();
        System.out.println(data);

        Object succesResponse = JSON.parse(data);
        Map map = (Map) succesResponse;
        Map map1 = (Map) map.get("payload");
        Map map2 = (Map) map1.get("std_data");
        Map map3 = (Map) map2.get("execution");

        if("0".equals(map3.get("code"))){

        }else{
            System.out.println(map3.get("description"));
        }




    }
}
